package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 权限类型
 *
 * @Author 00209
 * @Date 2021/03/01 22:01:45
 * @Version 1.0.0
 */

@AllArgsConstructor
@NoArgsConstructor
public enum PermTypeEnum {

    ROUTE(1, "路由权限√"),
    BUTTON(2, "按钮权限");

    @Getter
    @Setter
    private Integer code;
    @Getter
    @Setter
    private String name;

    public static PermTypeEnum getValue(Integer code) {
        for (PermTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}